<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
	<meta charset="utf-8">
    <title>Loads Page</title>
<?php echo link_tag(my_url().'skin.css'); ?>
<script type="text/javascript" src="<?php echo my_url(); ?>js/1.js"></script>
<script type="text/javascript" src="../js/1.js"></script>
<script src="<?php echo my_url(); ?>js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="<?php echo my_url(); ?>js/trhighlight.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
 var BaseURL='<?php echo base_url(); ?>';


function confirmDelete(loads_id){
	
	var x= window.confirm("Are you sure to delete this item?");
	if(x){
		window.location.href = BaseURL + "loads/delete_loads/" + loads_id;
	}	
}

</script>

<link rel="stylesheet" href="../skin.css" type="text/css" media="screen" /><meta name="author" content="Jaypee Mahilum" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link href="skin.css" rel="stylesheet" type="text/css" />
</head>

<?php
//echo $_SESSION['administrator_log']."============";
if(!isset($_SESSION['administrator_log']))
{
		echo"Log in first to access this page<html><title>WARNING</title><body><br><a href='".base_url()."administrator' />click here to log in.</a></body></html>";
}
else
{
?>
<body >
 

	<div class="BodyCover">
	 		<div class="ParentContent">
	        <?php require("owner_menu.php"); ?>
			<div class="MenuTab">
    			<div class="MenuBelow"><img src="<?php echo my_url();?>images/below-menu.gif"></div>        
             </div>
	   <div class="title">
			   <h1>Loads List:</h1>
            </div>                      

			<div class="module-index1">
		  		<div align="right"><a href="<?php echo base_url()?>admin/logout" style="color:#FF0000;">logout</a></div><br/>
  	                <?php if (isset($recordflag)) {echo $recordflag;}?><br />

                
		 <a href="<?php echo base_url() . "loads/add_loads/" ?>">
         	<img src=" <?php echo my_url() ."images/icons/action_add.gif" ?>" style='border:none'/> Add New Data</a><br /><br />	
            					  <form action="<?php echo base_url(); ?>loads/SearchLoads" method="post">
				<fieldset>
	                    <label><b>Search</b></label>
                    <input type="text" name="search_value" id="search_value" value="" size="20" />
					<label><b>by:</b></label>
                    <select id="column_value" name="column_value">	
						<?php if(isset($column_value)) {?>
								
								<?php if ($column_value=='') {?>
                                	<option value="" selected='selected'></option>                                
									<option value="load_no" >Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>
                                    
								<?php } if ($column_value=='load_no') {?>
                                	<option value=""></option>                                
									<option value="load_no" selected='selected' >Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='date') {?>	
                                	<option value=""></option>                                
									<option value="load_no">Load No</option>
									<option value="date" selected='selected'>Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>
                                    <option value="pick_up_place">Pick up Place</option>                                    <option value="pick_up_date">Pick up Date</option>                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='rep') {?>	
                                	<option value=""></option>                                
									<option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep" selected='selected'>rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>
                                    <option value="pick_up_place">Pick up Place</option>
                                    <option value="pick_up_date">Pick up Date</option>
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='bc_company_name') {?>	
                                	<option value=""></option>
									<option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name" selected='selected'>Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='bc_confrm_no') {?>	
                                	<option value=""></option>									
                                    <option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no" selected='selected'>Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='bc_rate') {?>	
									<option value=""></option>
                                    <option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate" selected='selected'>bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='pick_up_city') {?>	
									<option value=""></option>
									<option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city" selected='selected'>Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

								<?php } if ($column_value=='pick_up_state') {?>	
                                  	<option value=""></option>
									<option value="load_no">Load No</option>
								<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state" selected='selected'>Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

									<?php } if ($column_value=='pick_up_date') {?>	
                                  	<option value=""></option>
									<option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date" selected='selected'>Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

										<?php } if ($column_value=='dv_company_name') {?>	
                                  	<option value=""></option>
									<option value="load_no">Load No</option>
								<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name"selected='selected'>Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>

									<?php } if ($column_value=='contract_amount') {?>	
                                  	<option value=""></option>
									<option value="load_no">Load No</option>
								<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount" selected='selected'>Contract Amount </option>
							
							<?php }} else {?>
                                	<option value=""></option>
									<option value="load_no">Load No</option>
									<option value="date">Date</option>                                    
									<option value="rep">rep</option>                                    
									<option value="bc_company_name">Broker Company Name</option>
									<option value="bc_confrm_no">Confirm No.</option>                                       
									<option value="bc_rate">bc_rate</option>                                      
									<option value="pick_up_city">Pick up City</option>                                      
									<option value="pick_up_state">Pick up State</option>                                                                          
									<option value="pick_up_place">Pick up Place</option>                                                                          
									<option value="pick_up_date">Pick up Date</option>                                                                                                              
                                    <option value="dv_company_name">Vendor sCompany Name</option>
									<option value="contract_amount">Contract Amount </option>
						<?php } ?>
					</select>                
                    
					<input type="submit" value="Search" id="Search" />
				</fieldset>
		    </form>
          <br />	
                <div style='overflow:scroll;width:940px;height:400px;border:1pt solid #000;'>
                <table class='Grid' width='940px' border='1'>
                  <tr>
                        <th nowrap="nowrap">View</th>
                        <th nowrap="nowrap">Edit</th>
                        <th nowrap="nowrap">Load No.</th>
                        <th nowrap="nowrap">Date</th>
                        <th nowrap="nowrap">Rep</th>
                        <th nowrap="nowrap">B/C Company Name </th>                        
                        <th nowrap="nowrap">Confirmation No.</th>
                        <th nowrap="nowrap">B/C Rate</th>
  						<th nowrap="nowrap">Pick up Place</th>
  						<th nowrap="nowrap">Pick up City</th>                        
						<th nowrap="nowrap">Pick up State</th>
						<th nowrap="nowrap">Pick up Date</th>						
                        <th nowrap="nowrap">Drop off Place</th>                        
                        <th nowrap="nowrap">Drop off City</th>
						<th nowrap="nowrap">Drop off State</th>
                        <th nowrap="nowrap">Drop off Date</th>
                        <th nowrap="nowrap">D/V Company Name </th>                        
                        <th nowrap="nowrap">D/V Rate</th>
                        <th nowrap="nowrap">Comment </th>        
                        <th nowrap="nowrap">File Path</th>                        
                  </tr>
<?php
        		  $_rowClass = 'tr_odd';
                foreach($list_loads as $row)
                {
                         $load_no = $row->load_no;
						 $date = $row->date;
						 $rep = $row->rep;
						 $bc_company_name = $row->bc_company_name;
						 $bc_confrm_no = $row->bc_confrm_no;
						 $bc_rate = $row->bc_rate;						 
						 $pick_up_place = $row->pick_up_place;
						 $pick_up_city = $row->pick_up_city;
                         $pick_up_state = $row->pick_up_state;
                         $pick_up_date = $row->pick_up_date;
						 $drop_off_place = $row->drop_off_place;
						 $drop_off_city = $row->drop_off_city;
						 $drop_off_state = $row->drop_off_state;
						 $drop_off_date = $row->drop_off_date;
						 $dv_company_name = $row->dv_company_name;
						 $contract_amount = $row->contract_amount;
						 $comment_box = $row->comment_box;
						 $file_path = $row->file_path;
						 
?>					
					<tr class="<?php echo $_rowClass ?>"<?php echo GetTrEffects()?>>
						  	<td width='5'>
                                <a href="<?php echo base_url() . "loads/view_loads/" .$row->loads_id ?>">
                                	<img src="<?php echo my_url() . "images/icons/view.gif" ?>" style='border:none' />
                                </a>
							</td>
                        	<td width='5'>
                        	<a href="<?php echo base_url() . "loads/edit_loads/" . $row->loads_id ?>">
                            	<img src="<?php echo my_url() . "images/icons/edit.gif" ?>" style='border:none' />
                             </a>
							</td>
                        
							<td nowrap="nowrap"><?php echo $load_no ?></td>
                        	<td nowrap="nowrap"><?php echo $date?></td>
                        	<td nowrap="nowrap"><?php echo $rep?></td>                        
							<td nowrap="nowrap"><?php echo $bc_company_name?></td>
	                        <td nowrap="nowrap"><?php echo $bc_confrm_no?></td>
    	                    <td nowrap="nowrap" align="right"><?php echo $bc_rate?></td>                        
    	                    <td nowrap="nowrap"><?php echo $pick_up_place?></td>                        
        	                <td nowrap="nowrap"><?php echo $pick_up_city?></td>
            	            <td nowrap="nowrap"><?php echo $pick_up_state?></td>
            	            <td nowrap="nowrap"><?php echo $pick_up_date?></td>						
            	            <td nowrap="nowrap"><?php echo $drop_off_place?></td>
            	            <td nowrap="nowrap"><?php echo $drop_off_city?></td>
							<td nowrap="nowrap"><?php echo $drop_off_state?></td>
							<td nowrap="nowrap"><?php echo $drop_off_date?></td>
            	            <td nowrap="nowrap"><?php echo $dv_company_name?></td>
                	        <td nowrap="nowrap" align="right"><?php echo $contract_amount?></td>
                    	    <td nowrap="nowrap"><?php echo $comment_box?></td>
                    	    <td nowrap="nowrap"><?php echo $file_path?></td>                            
                  </tr>
<?php                  
				  if($_rowClass=="tr_odd") $_rowClass="tr_even"; else $_rowClass="tr_odd";     
                 }
?>
                 </table>
                 
                 </div> 
       
    		<br />

            <div class="BodyContent">
            </div>	
			    		
		    
		</div><!---end of ParentContent ---->
        <div class="Footer1">	
                <div class="Footer">Copyright &copy; 2011. All Rights Reserved <br><br>
                 <a href="http://webmartis.com"> <img src="<?php echo my_url();?>/images/wmlink.png"></a>
                 
                </div>                
            </div> <!---end of Footer1 ---->        
            
    </div> <!---end of BodyCover ---->
 
</body>
<?php } ?>
</html>

